#!/bin/bash -ex

SHOPPING_DIR="/home/aleks/repos/idlize/external/arkoala-arkts/shopping/user"

CMD_NATIVE_REBUILD="npm run compile:native:node-host --prefix .. -C ../.."
CMD_ARKOALA_REBUILD="npm run build:arkoala --prefix ../ -C ../.."
CMD_SHOPPING_PACK="npm run build:loader:node --prefix ../loader -C ../.."
CMD_SHOPPING_RUN="node  --interpreted-frames-native-stack --perf-basic-prof ../../build/index.js panda-ani:class=ohos.example.src.ets.entry.Entry 10"

cd $SHOPPING_DIR

$CMD_NATIVE_REBUILD
#$CMD_ARKOALA_REBUILD
$CMD_SHOPPING_PACK

ACE_LIBRARY_PATH=../../build \
PANDA_HOME=../../../incremental/tools/panda/node_modules/@panda/sdk \
$CMD_SHOPPING_RUN
